import website from "@/config/website";
import {SYSTEM_PREFIX} from "@/store/constant";

export const tableOption = {
  searchShow: true,
  searchMenuSpan: 6,
  tip: false,
  tree: true,
  border: true,
  index: true,
  selection: true,
  addBtn: false,
  viewBtn: true,
  menuWidth: 300,
  column: [
    {
      label: "部门名称",
      prop: "deptName",
      search: true,
      rules: [{
        required: true,
        message: "请输入部门名称",
        trigger: "blur"
      }]
    },
    {
      label: "所属租户",
      prop: "tenantId",
      type: "tree",
      dicUrl: SYSTEM_PREFIX + "/tenant/select",
      addDisplay: false,
      editDisplay: false,
      viewDisplay: website.tenantMode,
      span: 24,
      props: {
        label: "tenantName",
        value: "tenantId"
      },
      hide: !website.tenantMode,
      search: website.tenantMode,
      rules: [{
        required: true,
        message: "请输入所属租户",
        trigger: "click"
      }]
    },
    {
      label: "部门全称",
      prop: "fullName",
      search: true,
      rules: [{
        required: true,
        message: "请输入部门全称",
        trigger: "blur"
      }]
    },
    {
      label: "上级部门",
      prop: "parentId",
      dicData: [],
      type: "tree",
      hide: true,
      props: {
        label: "title"
      },
      rules: [{
        required: false,
        message: "请选择上级部门",
        trigger: "click"
      }]
    },
    {
      label: "排序",
      prop: "sort",
      type: "number",
      rules: [{
        required: true,
        message: "请输入排序",
        trigger: "blur"
      }]
    },
    {
      label: "备注",
      prop: "remark",
      span: 24,
      hide: true,
      rules: [{
        required: false,
        message: "请输入备注",
        trigger: "blur"
      }]
    }
  ]
}
